Units - Tough Nuts

Units - Tough Nuts

Armour based units (WW1 tank

Compatibility: Hot Seat, Affects Saved Games

Required Mods: DLL - Various Mod Components

Special thanks: _bane


Please note, this mod is only an example of how to change the base max hit points for a unit class (via the <Units> table) along with example promotions to give specific units additional max hit points, either as a fixed amount or a percentage of base max hit points.

It is NOT a complete stand-alone mod.

Changes XCOM squad to have 125 base hit points, and Mechs (GDRs) to have 150 base hit points.

Armour based units (WW1 tank through Modern Armour and Mechs) can gain the "Tough Nuts" and "Pain Immune" promotions to gain increses to their base hit points

Tough Nuts 1 - gain +15 hit points
Tough Nuts 2 - gain +25 hit points (requires Tough Nuts 1, so total gain is +40 hit points)

Pain Immune 1 - gain +10% base hit points
Pain Immune 2 - gain +20% base hit points (requires Pain Immune 1, so total gain is +30% bas hit points)

Note that modifiers are applied to base hit points, for example, a GDR unit with both Tough Nuts 1 and Pain Immune 1 promotions will gain ((150 * (100 + 10)/100) + 15) = 180 base hit points and not ((150 + 15) * (100 + 10)/100) = 181.5 (which rounds down to 181) base hit points.

To make it stand-alone, you will need to add and then mod three core game UI files - PlotMouseoverInclude.lua, EnemyUnitPanel.lua and UnitPanel.lua - to remove references to GameDefines.MAX_HIT_POINTS (also coded as GameDefines["MAX_HIT_POINTS"]) and replace them with pUnit:GetMaxHitPoints() (or appropriate variant).

Without the appropriate changes, a unit's hit points will show as (100 - damage), as the game tracks damage taken by a unit and not it's remaining hit points.

However, creating such a mod will make it incompatible with every other mod/pseudo-DLC that also alters any of these three files. Conversely, any mod that alters these three files while keeping the coding to GameDefines.MAX_HIT_POINTS will be incompatible with any mod trying to use the new max hit points feature(s).


Versions

v 230-Mar-2016 18:37:14
v 120-Mar-2016 14:44:25

Versions